﻿using System;
using System.Collections.Generic;
using Moe.ECamel.Common.Entities;

namespace Moe.ECamel.Common.Contracts
{
	/// <summary>
	/// Contract for libraries services.
	/// </summary>
	public interface ISubscriptionService : IECamelService
	{
		/// <summary>
		/// Get customer's subscriptions.
		/// </summary>
		/// <param name="customerId">Customer Id</param>
		/// <returns>List of customer's subscriptions.</returns>
		List<Subscription> GetSubscriptionsByCustomer(int customerId);
		/// <summary>
		/// Get Customer's active subscription (if any).
		/// </summary>
		/// <param name="customerId">Customer Id</param>
		/// <returns>Active subscription (null if none).</returns>
		Subscription GetActiveSubscriptionOfCustomer(int customerId);
		/// <summary>
		/// Creates a new subscription.
		/// </summary>
		/// <param name="subscription">Subscription details.</param>
		/// <returns>If successful - null, otherwise validation error.</returns>
		ECamelError CreateSubscription(Subscription subscription);
		/// <summary>
		/// Updates a subscription.
		/// </summary>
		/// <param name="subscriptionId">Id of subscription.</param>
		/// <param name="active">New subscription status.</param>
		/// <returns>If successful - null, otherwise validation error.</returns>
		ECamelError UpdateSubscriptionStatus(int subscriptionId, bool active);
		/// <summary>
		/// Renew subscription.
		/// </summary>
		/// <param name="subscriptionId">subscription to renew.</param>
		/// <param name="renewalDate">Date of renewal.</param>
		/// <returns></returns>
		ECamelError RenewSubscription(int subscriptionId, DateTime renewalDate);
	}
}